using System;
using System.IO;
using JsonFx.Json;
using UnityEngine;

public class ResourceFileSystem : IJsonFileSystem
{
	public string LoadContext(string key)
	{
		return PlayerPrefs.GetString(key);
	}

	public void SaveContext(string key, string content)
	{
		PlayerPrefs.SetString(key, content);
	}

	public string Read(string path)
	{
		return File.ReadAllText(string.Concat(new string[]
		{
			Application.dataPath,
			"/Data/text/",
			ResourceFileSystem.subPath,
			"/",
			path,
			".txt"
		}));
	}

	public void Write(string path, string content)
	{
		UnityEngine.Debug.LogError("ResourceFileSystem.Write is not implemented while writing " + path);
	}

	public static string subPath;
}
